package net.wofly.sale.order.util;


/**
 * 货物运输方式
 *
 * @author lign
 * @version 1.0
 * @created 30-12月-2017 15:35:29
 */
public enum GoodTransportType {
    送货上门(1, "送货上门"),
    门店自取(2, "门店自取");
    
    private Integer value;
    private String name;
    
    private GoodTransportType(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (GoodTransportType forEnum : values()) {
            if (value == forEnum.getValue()) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (GoodTransportType forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }
}